import router from './router'
import { Message } from 'element-ui'

// register global progress.
//const whiteList = ['/login', '/authredirect']// 不重定向白名单
router.beforeEach((to, from, next) => {
  var userId=sessionStorage.getItem('userId');
  if (!userId&& to.path != '/login' ) { // 判断是否有token
    next({ name: 'login'})
  } else {
    next()
  }
})

